define(
		[ "PDUtilDir/grid", "PDUtilDir/searchBlock" ],
		function(Grid, SearchBlock) {

			function init(cache, addObj, updateObj, delObj, searchObj) {
				SearchBlock.init('searchBlockId');
				// 初始化
				return Grid({
					id : "GirdDivId",
					pageSize : 10,
					index : true,
					multi : true,
					pagination : true,
					cache : false,
					layout : [
							{
								name : "中文名",
								field : "zhName",
								sort : true,
								click : function(e) {
									updateObj.run(e.data.row);
								}
							},
							{
								name : "英文名",
								field : "enName",
								sort : true,
								click : function(e) {
									updateObj.run(e.data.row);
								}
							},
							{
								name : "类型",
								field : "type",
								format : function(e) {
									return cache.typeMap.get(e.row.type);
								}
							},
							{
								name : "性别",
								field : "sex",
								format : function(e) {
									if (e.row.sex == "1")
										return '男';
									else
										return '女';
								}
							},
							{
								name : "年龄",
								field : "age"
							},
							{
								name : "联系电话",
								field : "phone"
							},
							{
								name : "证件类型",
								field : "certificates",
								format : function(e) {
									if (!cache.certificates)
										return;
									for (var i = 0; i < cache.certificates.length; i++) {
										if (cache.certificates[i].dictCode == e.row.certificates) {
											return cache.certificates[i].dictName;
										}
									}
								}
							}, {
								name : "证件号码",
								field : "certificatesNumber"
							} ],
					toolbar : [ {
						name : "添加",
						icon : "fa fa-plus-circle",
						callback : function(event) {
							addObj.run();
						}
					}, {
						name : "删除",
						icon : "fa fa-trash-o",
						callback : function(event) {
							delObj.run();
						}
					}, {
						name : "查询",
						icon : "fa fa-search",
						callback : function(event) {
							searchObj.run();
						}
					} ],
					data : {
						type : 'URL',
						value : getServer()
								+ '/flea/hclv/visitor/selectByDeptId.htmls'
					}
				});
			}
			return {
				init : init
			}
		});